import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { vitePluginFakeServer } from 'vite-plugin-fake-server'
import path from 'node:path'
// https://vite.dev/config/
export default defineConfig(({ mode }) => {
  return {
    define: {
      __DEV__: mode === 'development',
    },
    plugins: [
      vue(),
      vitePluginFakeServer({
        logger: false,
        enableProd: true,
        include: './mock',
      }),
    ],
    resolve: {
      alias: {
        '@': path.resolve(__dirname, './src'),
        '@pro/router': path.resolve(__dirname, './packages/router/src/index.ts'),
      }
    }
  }
})
